package Thread;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: homechen
 * Date: 2024-03-14
 * Time: 10:04
 */
public class MyThread extends Thread {
    public static volatile boolean isflag = true;

    public void stopThread() {
        isflag = false;
    }

    @Override
    public void run() {
        while (isflag) { // 不进行优化就是 false

        }
    }

    public static void main(String[] args) {
//        AtomicInteger atomicInteger = new AtomicInteger();
        ReentrantLock lock = new ReentrantLock();
    }
}
